/*
 * Josh Lindoo
 * Login ID : lind6441
 * CS-102, Winter 2013
 * Programming Assignment 2
 * ShellLinkedList class: Abstract class for general linked list features
 */

public abstract class ShellLinkedList<T> {
	protected Node<T> head; //link to head node
	protected int numberOfItems; //number of items in LL 
	
	//Constructor
	public ShellLinkedList() {
		head = null; //set head to null
		numberOfItems = 0; //initiate numberOfItems to 0
	}
	
	//Method Header
	public int size() {
		return numberOfItems;
	}
	
	//Method Header
	public boolean isEmpty() {
		return (numberOfItems == 0);
	}
	
	//Method Header
	public String toString() {
		String outputString = "";
		Node<T> current = head;
		for(int index = 0; index < numberOfItems; index++) {
			outputString += current.getData().toString() + "\n";
			current = current.getNext();
		}
		return outputString;
	}
}
